<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function detection() {
        let ty = document.getElementById("tid");
        let val = ty.value;
        //alert(val);
        let zz =/[1-9][0-9]{10}/;
        alert(zz.test(val));
        }
    </script>
</head>
<body>
    <input type="text" id="tid" value="123"><br>
    <input type="button" value="检测按钮" onclick="detection()">
</body>
</html>